package com.wuye.basic.service.impl;

import java.util.Collections;
import java.util.List;

import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuye.basic.mapper.WyHometypeMapper;
import com.wuye.basic.domain.WyHometype;
import com.wuye.basic.service.IWyHometypeService;

/**
 * 房间类型Service业务层处理
 * 
 * @author 小停再出发
 * @date 2024-11-22
 */
@Service
public class WyHometypeServiceImpl extends ServiceImpl<WyHometypeMapper, WyHometype>
        implements IWyHometypeService
{
    @Autowired
    private WyHometypeMapper wyHometypeMapper;

    /**
     * 查询房间类型
     * 
     * @param homeTypeId 房间类型主键
     * @return 房间类型
     */
    @Override
    public WyHometype selectWyHometypeByHomeTypeId(Long homeTypeId)
    {
        return wyHometypeMapper.selectWyHometypeByHomeTypeId(homeTypeId);
    }

    /**
     * 查询房间类型列表
     * 
     * @param wyHometype 房间类型
     * @return 房间类型
     */
    @Override
    public List<WyHometype> selectWyHometypeList(WyHometype wyHometype)
    {
        return wyHometypeMapper.selectWyHometypeList(wyHometype);
    }

    /**
     * 新增房间类型
     * 
     * @param wyHometype 房间类型
     * @return 结果
     */
    @Override
    public int insertWyHometype(WyHometype wyHometype)
    {
        return wyHometypeMapper.insertWyHometype(wyHometype);
    }

    /**
     * 修改房间类型
     * 
     * @param wyHometype 房间类型
     * @return 结果
     */
    @Override
    public int updateWyHometype(WyHometype wyHometype)
    {
        return wyHometypeMapper.updateWyHometype(wyHometype);
    }

    /**
     * 批量删除房间类型
     * 
     * @param homeTypeIds 需要删除的房间类型主键
     * @return 结果
     */
    @Override
    public int deleteWyHometypeByHomeTypeIds(Long[] homeTypeIds)
    {
        return wyHometypeMapper.deleteWyHometypeByHomeTypeIds(homeTypeIds);
    }

    /**
     * 删除房间类型信息
     * 
     * @param homeTypeId 房间类型主键
     * @return 结果
     */
    @Override
    public int deleteWyHometypeByHomeTypeId(Long homeTypeId)
    {
        return wyHometypeMapper.deleteWyHometypeByHomeTypeId(homeTypeId);
    }

    /**
     * @description: 分页查询全部房间类型
     * @param wyHometype
     * @return java.util.List<com.wuye.basic.domain.WyHometype>
     **/
    @Override
    public List<WyHometype> listByHomeType(WyHometype wyHometype) {
        return   lambdaQuery()
                .like(CharSequenceUtil.isNotBlank(wyHometype.getHomeType()),WyHometype::getHomeType, wyHometype.getHomeType())
                .list();
    }




}
